Langs
$ npm install langs
This library provides ISO 639-1/2/3 language codes with English and local
names. It can be installed in whichever way you prefer, but I recommend
NPM.
What's with all the ISO version numbers?
ISO 639 is broken up into many different parts, each either defining language
codes or defining standards for codes in later versions. The ones included in
this library are:
ISO 639-1
2 characters, one per language or ISO 639 macrolanguageISO 639-2/2T
3 characters, one per languageISO 639-2B
3 characters, mostly the same as 639-2T
but with some derived from their English name rather than local nameISO 639-3
3 characters, mostly the same as 639-2T
but using the canonical ISO 639 macrolanguage code
The macrolanguages described above cover cases where a language is considered
to be a dialect of another in some standards but not in others, e.g Standard
Arabic arb
and Arabic ara
. There's more information on the
Wikipedia page.
Documentation
var langs = require('langs');
langs.all();
langs.names();
langs.names(true);
langs.codes("1");
langs.codes("2T" );
langs.codes("2B");
langs.codes("3");
langs.where("name", "Korean");
langs.where("local", "한국어, 조선어");
langs.where("1", "ko");
langs.where("2", "kor");
langs.where("2T", "kor");
langs.where("2B", "kor");
langs.where("3", "kor");
langs.has("name", "Korean");
langs.has("local", "한국어, 조선어");
langs.has("1", "ko");
langs.has("2", "kor");
langs.has("2T", "kor");
langs.has("2B", "kor");
langs.has("3", "kor");
langs.has("name", "Geordie");
langs.has("high", "fives");
Contributing
I accept contributions to the source via Pull Request, but passing unit tests
must be included before it will be considered for merge.
$ curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/nodejs/Vagrantfile
$ vagrant up
$ vagrant ssh
$ cd /srv
$ npm test
License
The content of this library is released under the MIT License by
Andrew Lawson.
You can find a copy of this license in
LICENSE
or at http://www.opensource.org/licenses/mit.